package com.isoft.c2team3service2.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("comment")
public class Comment {
    @TableId(type = IdType.AUTO)
    private Integer id;

    // 关键修改：articleId → postId，关联帖子ID（Post.id）
    private Integer postId;

    private String content;
    @TableField(fill = FieldFill.INSERT)
    private String filteredContent;
    @TableField(fill = FieldFill.INSERT)
    private Integer userId;
    @TableField(fill = FieldFill.INSERT)
    private Long parentId; // 若为回复评论，关联父评论ID（可保留）
    @TableField(fill = FieldFill.INSERT)
    private String nickName;
    @TableField(fill = FieldFill.INSERT)
    private Integer status; // 1=正常，0=删除（可保留）

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}